﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using static C__study_2025_1_20.Hero;

namespace C__study_2025_1_20
{
    enum E_Status
    {
        OnLine=1,
        OutLine,
        Sleep,
        DoNotDisturb
        
        
    }
    enum E_Coffee_Cup
    {
        Mid = 35,
        Pro = 40,
        ProMax = 43,
    }
   
    public class Hero
    {
        public enum E_Hero_Sex
        {
            male=1,

            female,
        }
        public enum E_Hero_Profession
        {
            Warrior=1,
            Hunter,
            Mage,
        }
        public enum E_Skill
        {
            Charge=1,
            SuspendedAnimation,
            ArcaneImpact,
        }
        public int atk;
        public int def;
        public E_Hero_Sex sex;
        public E_Hero_Profession hero_profession;
        public E_Skill skill;
        public void GetSkill(Hero hero,int profession)
        {

            hero.skill = (E_Skill)Enum.Parse(typeof(E_Skill), profession.ToString());
           
        }
        public void CalculateMainProperty(Hero hero,int sex,int profession)
        {
            switch(sex)
            {
                case 1: hero.atk += 50; hero.def += 100; break;
                case 2: hero.atk += 150; hero.def += 20; break;
            }
            switch(profession)
            {
                case 1: hero.atk += 20; hero.def += 100; break;
           
                case 2: hero.atk += 120; hero.def += 30; break;

                case 3: hero.atk += 200; hero.def += 10; break;
            }
        }
        
    }
    
   
    internal class Program
    {   
          static void Main(string[] args)
          {
            
          Console.WriteLine("Please enter your state:\n" + "1 is \"online\",2 is \"outline\" 3 is sleep,4 is \"Don't disturb\"");//选择状态
          E_Status state = (E_Status)Enum.Parse(typeof(E_Status), Console.ReadLine());//把输入的状态转换为枚举类型的值

          Console.WriteLine("your status is " + state);//打印你的状态

          Console.WriteLine("Please choose your size of coffee:\n" + " Mid , Pro , ProMax ");//输入杯子型号中杯，大杯超大杯
          E_Coffee_Cup size = (E_Coffee_Cup)Enum.Parse(typeof(E_Coffee_Cup), Console.ReadLine());//把输入的杯子型号转换为枚举类型的变量

          Console.WriteLine("You purchase " + size + " coffee,expend " + (int)size + " yuan");//打印你的购买信息

          Hero hero = new Hero();//实例化一个类
          Console.WriteLine("Enter your sex(male or female)");//询问男人还是女人
          hero.sex = (E_Hero_Sex)Enum.Parse(typeof(E_Hero_Sex), Console.ReadLine());//将得到的string类型的性别转换为枚举类型
          Console.WriteLine("Please choos your profession( Warrior,Hunter,Mage)");
          hero.hero_profession = (E_Hero_Profession)Enum.Parse(typeof(E_Hero_Profession), Console.ReadLine());
          hero.GetSkill(hero,(int)hero.hero_profession);
          hero.CalculateMainProperty(hero,(int)hero.sex, (int)hero.hero_profession);
          Console.WriteLine("You choose "+hero.sex+hero.hero_profession+",atk is "+hero.atk+",def is "+hero.def+",your skill is "+hero.skill);
        

        }
        }
}

